package com.fanhang.samples.spring.tiles.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping(value = "/demo")
public class DemoController {

	@RequestMapping(value = "/welcome", method = { RequestMethod.GET })
	public void welcome() {
		
	}

	@RequestMapping(value = "/hello", method = { RequestMethod.GET })
	public ModelMap hello(HttpServletRequest request) {
		String name = (String) request.getAttribute("name");
		return new ModelMap("name", name);
	}

}